[IA64] Fix NVRAM data cannot be saved when guest execute "reboot"
authorAlex Williamson <alex.williamson@hp.com>
Mon, 2 Jul 2007 15:38:51 +0000 (09:38 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Mon, 2 Jul 2007 15:38:51 +0000 (09:38 -0600)
Also fix "xm reboot" instruction in Xend.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
tools/ioemu/target-i386-dm/helper2.c
tools/ioemu/vl.h
tools/python/xen/xend/XendDomainInfo.py

index 5f106b5a3a50f13721f5af82eaf41947497a4c50..971ff257dbfdfc93340f7f32bc5f0e12a2314b79 100644 (file)
@@ -140,6 +140,7 @@ void cpu_reset(CPUX86State *env)
     if (xcHandle < 0)
         fprintf(logfile, "Cannot acquire xenctrl handle\n");
     else {
+        xc_domain_shutdown_hook(xcHandle, domid);
         sts = xc_domain_shutdown(xcHandle, domid, SHUTDOWN_reboot);
         if (sts != 0)
             fprintf(logfile,
index 3e4e191e2eada23d97ec63f5081e38947651d8bb..313a23625d42394ab3340bcdce08c7ec5b348179 100644 (file)
@@ -1498,4 +1498,13 @@ void destroy_hvm_domain(void);
 /* VNC Authentication */
 #define AUTHCHALLENGESIZE 16
 
+#ifdef __ia64__
+static inline void xc_domain_shutdown_hook(int xc_handle, uint32_t domid)
+{
+       xc_ia64_save_to_nvram(xc_handle, domid);
+}
+#else
+#define xc_domain_shutdown_hook(xc_handle. domid)      do {} while (0)
+#endif
+
 #endif /* VL_H */
index 2f9eb592f51407080ac78d60c590da8ab8d9a0eb..6860faa9e5d8bf2d4a6de9961c82d797e18d74c5 100644 (file)
@@ -459,6 +459,7 @@ class XendDomainInfo:
             hvm_pvdrv = xc.hvm_get_param(self.domid, HVM_PARAM_CALLBACK_IRQ)
             if not hvm_pvdrv:
                 code = REVERSE_DOMAIN_SHUTDOWN_REASONS[reason]
+                xc.domain_destroy_hook(self.domid)
                 log.info("HVM save:remote shutdown dom %d!", self.domid)
                 xc.domain_shutdown(self.domid, code)